package com.sright.bcard.content.biz.manager.impl;

import com.sright.bcard.content.biz.manager.FeedbackManager;
import com.sright.bcard.content.dal.dao.FeedbackDAO;
import com.sright.bcard.content.dal.entity.FeedbackDO;
import com.sright.bcard.content.share.request.FeedBackParamRequest;
import com.sright.bcard.user.dal.dao.MemberDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FeedbackManagerImpl implements FeedbackManager {

    @Autowired
    FeedbackDAO feedbackDAO;

    @Autowired
    MemberDAO memberDAO;

    @Override
    public Long addFeedback(FeedBackParamRequest feedBackParamRequest) {
        FeedbackDO feedbackDO = new FeedbackDO();
        feedbackDO.setUserId(feedBackParamRequest.getMemberId());
        feedbackDO.setContent(feedBackParamRequest.getContent());
        feedbackDO.setMobile(feedBackParamRequest.getMobile());
        return feedbackDAO.insertSelective(feedbackDO);
    }
}
